package com.xxx.common.model;

import lombok.Getter;

public enum RespEnum {
	
	/**
	 * System
	 */
	SUCCESS(200, "请求成功"),
	DATABASE_CONECT_ERROR(300 , "数据库连接异常"),
	DATABASE_BIND_ERROR(301 , "数据库参数绑定异常"),
	ERROR_SYSTEM_PARAM(302, "系统参数配置错误"),
	ERROR_INNER_DATA(303, "内部数据错误"),
	GET_ERROR_SYSTEM_PARAM(304, "获取系统参数错误"),
	REDIS_CONECT_ERROR(305, "Redis连接异常"),
	SERVER_ERROR(500, "服务器正在维护，请稍后重试"),
	REQUEST_PARAM_ERROR(2000, "请求参数不正确"),
	REQUEST_REDIS_PARAM_ERROR(2001, "缓存参数不正确"),
	REQUEST_REDIS_STATUS_ERROR(2002, "缓存状态不正确"),
	USER_AUTHENTICATION(400, "用户验证失败"),
	LONG_TERM_USER_NOT_LOGGED_IN(401, "用户长期未登录"),
	SYSTEM_AUTHENTICATION(405 , "非法请求"),
	GET_MESSAGE_ERROR(406 , "获取信息失败"),


	SERVER_TASK_ERROR(502 , "定时器异常"),





	/**
	 * User
	 */
	NO_THIS_USER(3001 , "该用户不存在"),
	USERNAME_PASSWORD_ERROR(3014 , "账号或者密码错误"),
	PASSWORD_IS_LOCK(3015 , "输入密码出错过多，账户已被锁定%s小时，请稍后登录。"),
	USER_PWD_FAILED(3020 , "密码修改失败"),
	USER_PWD_ERROR(3021 , "密码不正确，您还可以输入%s次"),
	USER_PWD_VERIFY(3022 , "新密码和确认密码输入不匹配"),
	USER_PHONE_VERIFY(3023 , "请输入注册时填写的手机号"),
	USER_AUTHENTICATION_TYPE_FAIL(3024, "第三方登录验证，类型错误，当前仅支持qq，微信，新浪微博"),
	USER_AUTHENTICATION_OUT_TIME(3025, "第三方登录验证凭证已过期"),
	USER_AUTHENTICATION_FAIL(3026 , "第三方登录失败"),
	UPDATE_MY_FILES_FAILED(3034, "修改我的信息失败"),
	OLD_PASSWORD_INCORRECT(3040, "旧密码不正确"),
	OLD_AND_NEW_PASSWORD_INCORRECT(3041, "新密码与旧密码一致，请重新填写"),
	PASSWORD_IS_NOT_SAME(3042, "您两次输入的密码不一致，请点击图标显示密码核对后再次设置"),
	USER_LOGIN_PWD_ERROR_COUNT(3043, "今日输入错误次数已达上限;请24小时后再次操作，若有疑问请联系客服"),
	USER__LOGIN_PWD_ERROR(3044, "您输入的密码有误，今日还有%s次输入机会"),
	USER_ACCOUNT_ABNORMAL(3045, "账户状态异常，请联系客服人员"),
	USER_EXIST(3046, "用户已存在"),

	VERIFICATION_CODE_HAS_FAILED(3102, "验证码已失效"),


	NO_AUTHORITY_PLEASE_CONTACT_THE_ADMINISTRATOR_TO_AUTHORIZE(1008, "没有权限，请联系管理员授权"),



	/**
	 * 微信登录注册
	 */
	USER_WE_CHART_LOGIN_ERROR(3200, "微信登录异常"),
	USER_WE_CHART_THIRD_INFO_ERROR(3201, "获取微信登录信息失败"),
	USER_WE_CHART_MINI_INFO_ERROR(3211, "获取微信小程序信息失败"),

	/**
	 * 微信登录注册
	 */
	USER_QQ_LOGIN_ERROR(3202, "QQ登录异常"),
	USER_QQ_THIRD_INFO_ERROR(3203, "获取QQ登录信息失败"),

	/**
	 * 新浪登录注册
	 */
	USER_SINA_LOGIN_ERROR(3204, "新浪微博登录异常"),
	USER_SINA__THIRD_INFO_ERROR(3205, "获取新浪微博登录信息失败"),

	/**
	 * Sms
	 */
	SMS_CODE_ERROR(5001, "验证码有误"),
	SMS_SEND_ERROR(5002, "发送验证码失败"),
	SMS_SEND_OUT_NUMBER(5003, "获取次数已达上限，请今晚12点后再试"),
	SMS_SEND_LOG_SAVE_ERROR(5004, "发送验证码,日志记录保存失败"),
	REPEAT_SEND_SMS_TIME(5005, "1分钟内只能发送1条验证码"),
	SMS_CODE_SUCCESS(5006, "手机号验证成功"),
	ENT_CODE_IS_GREATER_FIVE(5007, "验证码已输错3次将锁定时长为3小时，请稍后再试"),
	USER_MOBILE_FAIL(5008, "用户手机号校验失败"),



	;

	@Getter
	private final int code;

	private final String desc;

	public String getDesc() {
		return desc;
	}

	public String getDefaultDesc() {
		return desc;
	}

	RespEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
}
